import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    meta: {
      keepAlive: true
    },
    component: () => import('@/views/home/Home.vue')
  },
  {
    path: '/category',
    meta: {
      keepAlive: true
    },
    component: () => import('@/views/category/Category.vue')
  },
  {
    path: '/profile',
    meta: {
      keepAlive: true
    },
    component: () => import('@/views/profile/Profile.vue')
  },
  {
    path: '/card',
    meta: {
      keepAlive: true
    },
    name: 'card',
    component: () => import('@/views/card/Card.vue')
  },
  {
    path: '/detail',
    meta: {
      keepAlive: true
    },
    name: 'detail',
    component: () => import('@/views/detail/Detail.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
